<!--
 * @Author: 郭招娣 10615594+guo-zhaodi@user.noreply.gitee.com
 * @Date: 2022-09-26 11:41:43
 * @LastEditors: 郭招娣 10615594+guo-zhaodi@user.noreply.gitee.com
 * @LastEditTime: 2022-10-07 16:46:20
 * @FilePath: \客户端\app\src\views\Message\index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->

<template>
  <div>
    <span ref="qrCodeUrl"></span>

    <a :href="`https://gitee.com/oauth/authorize?client_id=${client_id}&redirect_uri=${redirect_uri}&response_type=code`">第三方登录</a>
  </div>
</template>
<script>
import QRCode from "qrcodejs2";
export default {
  data() {
    return {
      client_id:'23f85b43816b15daeee77c54e92f1e7c139109fcf15f5c7f970c724745e4eb19',
      redirect_uri:'http://localhost:7001/api/auth'
    };
  },
  mounted() {
    this.creatQrCode();
  },
  methods: {
    creatQrCode() {
      let a = new QRCode(this.$refs.qrCodeUrl, {
        text: "金俊霖是大帅哥", // 需要转换为二维码的内容
        width: 100,
        height: 100,
        colorDark: "black", //#000000为黑色
        colorLight: "white",
      });
      console.log("二维码:", a);
    },
  },
};

</script>